Repository navigation
Check if the release is published with the hex.pm API - #261
Merged
Merged
Conversation
The release workflow no longer installs the Hex archive, so `mix hex.info` failed on every push to main and the step fell through to publishing. Only publish on a 404 and fail the job on any other response.
starbelly
approved these changes
Nov 6, 2026
ericmj
commented
Nov 6, 2026
| else | ||
| rebar3 hex publish --yes --wait | ||
| fi | ||
| status=$(curl --silent --show-error --output /dev/null --write-out '%{http_code}' "https://hex.pm/api/packages/hex_core/releases/$VERSION") |
Member
Author
There was a problem hiding this comment.
@starbelly Would be great to have something like mix hex.info in rebar3_hex so we don't have to use curl here.
Contributor
There was a problem hiding this comment.
Agreed. Will take a swing at it this Saturday!
Member
Author
There was a problem hiding this comment.
FYI, added this hex to differentiate exit codes: hexpm/hex#1309
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since #259 the release workflow doesn't install the Hex archive, so the
mix hex.infocheck in the publish step fails withThe task "hex.info" could not be foundon every push to main. The step treated that failure as "not published" and ranrebar3 hex publish, which hex.pm rejected for 0.21.1 in https://github.com/hexpm/hex_core/actions/runs/42227736305/job/127925415950.The step now asks
https://hex.pm/api/packages/hex_core/releases/$VERSIONfor its HTTP status. It publishes on a 404, skips on a 200, and fails the job on any other status or a connection error, so a failed check no longer leads to a publish. This also removes the leftoverMIX_EXS: publish.exs.